<?php
class Model_Navigate
{
    public static function getPageListBar($total, $page, $pageSize, $pageListSize = 10)
    {
        $pageListBarObj   = new Eren_PageListBar($total, $page, $pageSize, $pageListSize);
        $ret['nowPage']   = $pageListBarObj->getNowPage();
        $ret['prePage']   = $pageListBarObj->getPrePage();
        $ret['nextPage']  = $pageListBarObj->getNextPage();
        $ret['firstPage'] = $pageListBarObj->getFirstPage();
        $ret['lastPage']  = $pageListBarObj->getLastPage();
        $ret['pageList']  = $pageListBarObj->getPageList();
        return $ret;
    }
    
    public static function getLimit($page, $pageSize)
    {
        $page = intval($page) > 0 ? intval($page):1;
        $ret['start'] = ($page-1)*$pageSize;
        $ret['limit'] = $pageSize;
        return $ret;
    }
}